const express = require("express");
const app = express();

// 连接mongodb数据库
require("./plugins/db")(app);

// express开放静态资源
app.use("/uploads", express.static("uploads"))

app.use(express.json());

// 定义admin路由
require("./routes/admin")(app);
// 定义web路由
require("./routes/web")(app)

// 以3000端口号启动服务
app.listen(5000, () => {
  console.log("server is running 5000 port");
});